package com.atguigu.java.ai.langchain4j;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;

import static dev.langchain4j.service.spring.AiServiceWiringMode.EXPLICIT;

/**
 * @Author: LZY
 * @Date: 2025/09/01 18:57
 * @Description:
 **/
@AiService(wiringMode = EXPLICIT,
        chatModel = "qwenChatModel",
        //  chatMemory = "chatMemory", //聊天记忆
        chatMemoryProvider = "chatMemoryProvider"  //聊天记忆+隔离记忆
)
public interface Assistant {
    String chat(String userMessage);

    //重载

    /**
     * 分离聊天记录
     *
     * @param memoryId    聊天id
     * @param userMessage 用户消息
     * @return
     */
    String chat1(@MemoryId Long memoryId, @UserMessage String userMessage);
}
